﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LanMuEdit.aspx.cs" Inherits="Manager_LanMuEdit" ValidateRequest="false" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>文章管理</title>
    <link href="/Manager/css/admin.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/Manager/js/jquery-1.6.1.min.js"></script>    
    <script type="text/javascript" src="/Manager/js/admin.js"></script>
    <!--kindEditor配置Begin-->
    <link rel="stylesheet" href="/Manager/js/kindeditor/themes/default/default.css" />
    <link rel="stylesheet" href="/Manager/js/kindeditor/plugins/code/prettify.css" />
    <script type="text/javascript" charset="utf-8" src="/Manager/js/kindeditor/kindeditor-min.js?v=4.1.7"></script>
    <script type="text/javascript" charset="utf-8" src="/Manager/js/kindeditor/lang/zh_CN.js?v=4.1.7"></script>
    <script type="text/javascript" charset="utf-8" src="/Manager/js/kindeditor/plugins/code/prettify.js?v=4.1.7"></script>
    <script type="text/javascript">
        //此编辑器初始化参数请参考http://www.kindsoft.net/docs/option.html
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('#content', {
                cssPath: '/Manager/js/kindeditor/plugins/code/prettify.css',
                filterMode: false,
                urlType: 'absolute',
                uploadJson: '/Manager/ajax/upload_json.ashx?width=600&height=520'   //指定上传文件的服务器端程序
                //fileManagerJson: 'Ajax/file_manager_json.ashx',     //指定浏览远程图片的服务器端程序
                //allowFileManager: false
            });
            prettyPrint();
        });
    </script>
    <!--kindEditor配置End-->
    <!--uploadify配置Begin-->
    <link rel="stylesheet" href="/Manager/js/uploadify/uploadify.css" />
    <script type="text/javascript" charset="utf-8" src="/Manager/js/uploadify/jquery.uploadify.js"></script>
	<script type="text/javascript">
	    $(function () {
	        $('#file_upload').uploadify({
	        'buttonText': '上传封面图片',
	        'queueSizeLimit': 1,
	        'swf': '/Manager/js/uploadify/uploadify.swf',
	        'uploader': '/Manager/Ajax/uploadify.ashx?t=2',
	        'onUploadSuccess': function (file, data, response) {
	            var obj = $.parseJSON(data);
	            if (obj.error == 0) {
	                $("#picUrl").val(obj.url);
	            }
	            else {
	                alert(obj.message);
	            }
	        }
	    });
	});
	</script>
    <!--uploadify配置End-->
</head>
<body>
    <div class="titlebt">修改文章栏目</div>
    <!--显示列表-->
    <div id="all">
        <div class="k_all3">
            <form id="form1" action="" method="post" onsubmit="return checkdata();">
            <table width="100%" cellpadding="0" cellspacing="0" id="bk">
                <tbody>
                    <tr>
                        <td width="100" height="35" align="right">
                            <span class="red">*</span>显示方式：
                        </td>
                        <td width="990">
                            <input id="radioSourceUrl1" name="radioSourceUrl" type="radio" <%if(string.IsNullOrEmpty(sourceUrl)) {%> checked="checked"<%} %>  onclick="chengSourceUrl('1')"/><label for="radioSourceUrl1">内容显示</label>
                            <input id="radioSourceUrl2" name="radioSourceUrl" type="radio" <%if(!string.IsNullOrEmpty(sourceUrl)) {%> checked="checked"<%} %>  onclick="chengSourceUrl('0')"/><label for="radioSourceUrl2">外链显示</label>
                        </td>
                    </tr>
                    <tr>
                        <td width="100" height="35" align="right">
                            <span class="red">*</span>栏目名称：
                        </td>
                        <td width="990">
                            <input type="text" id="name" name="name" value="<%=name %>" style="width:350px" data-val="true" data-val-required="*请填写栏目名称！"/>
                            <span class="field-validation-valid" data-valmsg-for="name" data-valmsg-replace="true"></span>
                        </td>
                    </tr>
                    <tr class="notSourceUrl">
                        <td width="100" height="35" align="right">
                            地址友好名称：
                        </td>
                        <td width="990">
                            <span>当无外链地址时，有优化url地址作用，但在一级栏目[<%=Utility.GetLanmuUrlNmae(pid)%>]下必须唯一。<br/>
                            </span>
                            /<%=Utility.GetLanmuUrlNmae(pid)%>-<input type="text" id="urlName" name="urlName" value="<%=string.IsNullOrEmpty(urlName)?cid.ToString():urlName %>" style="width:100px"/>.html
                        </td>
                    </tr>
                    <tr class="isSourceUrl">
                        <td width="100" height="35" align="right">
                            外链地址：
                        </td>
                        <td width="990">
                            <span>优先级最高，有此链接，则此栏目直接跳转此地址<br/></span>
                            <input type="text" id="sourceUrl" name="sourceUrl" value="<%=sourceUrl %>" style="width:350px"/>
                        </td>
                    </tr>
                    <tr class="notSourceUrl">
                        <td width="100" height="35" align="right">
                            <span class="red">*</span>栏目内容：
                        </td>
                        <td width="990">
                            <span id="field-content" class="field-validation-error" style="display:none">*请填写新闻内容！</span>
                            <textarea id="content" name="content" style="width: 90%; height: 350px;"><%=HttpUtility.HtmlDecode(content)%></textarea>
                        </td>
                    </tr>
                    <%--<tr>
                        <td width="100" height="35" align="right">
                            栏目图片：
                        </td>
                        <td width="990">
		                    <input id="picUrl" name="picUrl" type="text" value="<%=picUrl %>" style="width:350px">
                            <div>   
                                <input id="file_upload" name="file_upload" type="file" multiple="true"/>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td width="100" height="35" align="right">
                            栏目图片标题：
                        </td>
                        <td width="990">
                            <input type="text" id="picTitle" name="picTitle" value="<%=picTitle %>" style="width:350px"/>
                        </td>
                    </tr>--%>
                    <tr>
                        <td colspan="2" height="35">
                            <div class="pl200">
                                <input type="submit" class="butt_tle" style="width: 50px" value="确定" />
                                <input type="button" class="butt_tle" style="width: 80px" value="返回列表" onclick='location.href="LanMuList.aspx?cid=<%=pid %>"'/>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            </form>
        </div>
    </div>
    <script type="text/javascript">
        function checkdata() {
            //if (editor.text() == "") {
            //    $("#field-content").show();
            //    return false;
            //}
            return true;
        }
        chengSourceUrl('<%=string.IsNullOrEmpty(sourceUrl)?"1":"0" %>');
        function chengSourceUrl(v) {
            if (v == "1") {
                $(".notSourceUrl").show();
                $(".isSourceUrl").hide();
            }
            else {
                $(".notSourceUrl").hide();
                $(".isSourceUrl").show();
            }
        }
    </script>
</body>
</html>